#ifndef _TCPLIB_COMMON_HPP_
#define _TCPLIB_COMMON_HPP_

#include <cstdlib>
#include <stdint.h>
#include <unistd.h>

namespace tcplib { 

const int NULL_FD = -1;

class Noncopyable
{
private:
    Noncopyable &operator=(Noncopyable& dst)
    {
        return *this;
    }
};


#define closefd(fd) do {\
    if (fd >= 0) close(fd);\
    fd = NULL_FD;\
}

void panic(const char *msg);

};


#endif

